/**
@description api文件

@copyright    Copyright 2021 高灯科技
@version      1.0.0
@link         https://www.goldentec.com
@author       venki.chen <venki.chen@goldentec.com>
@datetime     2021/11/19 10:39
*/

package api

import (
	"fmt"
	"html/template"
	"net/http"
)

func SayHello(w http.ResponseWriter, r *http.Request) {
	// 解析模板
	files, err := template.ParseFiles("../view/sayHello.tmpl")
	if err != nil {
		fmt.Printf("Parse template failed err=%v", err)
		return
	}

	// 渲染模板
	err = files.Execute(w, "venki.chen")
	if err != nil {
		fmt.Printf("render template failed err:%v", err)
		return
	}
}
